<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/7/17 0017
 * Time: 10:32
 */

namespace app\admin\controller;


use think\Db;

class Data extends Middle
{
    public function index(){
        $list = Db::name('price_set')->select();
        return $this->returnSuccess($list);
    }
  
  	public function set(){
        $id = isset($this->data['id']) ? $this->data['id'] : $msg = '请选择参数';
        $x  = isset($this->data['x'])  ? $this->data['x']  : $msg = '请设置参数值';
        $set = ['x'=>$x,'id'=>$id];
        $res = Db::name('price_set')->update($set);
        if($res)return $this->returnSuccess('操作成功');
        return $this->returnError($this->Error);      
    }
}